if WhichItem is in "Quit HyperCard,New Card,Cut Card,Delete Card," &"Find...,Copy Card,Print Card,Print Stack...,Print Report...," &"Card Info..." then
if WhichItem is "Quit HyperCard" then
if the freesize of this stack > 2000 and the diskspace > the size of this stack then
Answer "Straighten sheets and remove stray scraps of paper?" with "Compact" or "Next time" or "Cancel"
if it is "Cancel" then
exit doMenu
end if
If it is "Compact" then
if cantmodify of this stack is false then
go first cd
set rect of cd fld "Ref" to 29,146,434,203
put textSize of cd fld "Ref" into tempS
put textAlign of cd fld "Ref" into tempA
set textSize of cd fld "Ref" to 14
set textAlign of cd fld "Ref" to center
Put return &"Removing smudges, aligning sheets, and capping inkwell." into cd fld "Ref"
lock screen
show cd fld "Ref"
unlock screen with dissolve
doMenu "Compact Stack"
lock screen
hide cd fld "Ref"
unlock screen with dissolve
set textSize of cd fld "Ref" to tempS
set textAlign of cd fld "Ref" to TempA
else
show menuBar
answer "The Cantmodify of this stack is set to true," &" so compacting is impossible at this time. Next session?" with "OK"
pass doMenu
end if
else
if it is "Next time" then
pass domenu
end if
end if
pass domenu
else
pass doMenu
end if
end if
if whichItem is "New Card" then
if cantmodify of this stack is false then
set cursor to 3
lock screen
go last cd of this bg
doMenu "Copy Card"
doMenu "Paste Card"
erasePage
unlock screen with wipe left
play "Harpsichord" "a"
exit doMenu
else
beep
exit doMenu
end if
end if
if whichItem is "Copy Card" then
if textFont of bg fld "Text" is not "marker" then
pass doMenu
else
beep
end if
end if
if whichItem is in "Cut Card,Delete Card" then
if textfont of bg fld "Text" is not "marker" then
if cantmodify of this stack is false then
cleanScreen
if id of this cd is "card id 3048" then
answer "You mustn't throw away the cover sheet."
exit doMenu
end if
answer "Throw this sheet away?" with "Yes" or "No"
if it is "Yes" then
if number of cds > 2 then
set cantdelete of this cd to false
set cursor to 3
lock screen
play "Harpsichord" "b"
pass doMenu
else
beep
Answer "You mustn't throw away the last sheet of this" &" journal. Erase this entry?" with "Yes" or "No"
if it is "Yes" then
erasePage
play "Harpsichord" "a"
else
end if
end if
end if
exit doMenu
else
beep
answer "Deprotect the journal, please?" with "OK"
exit doMenu
end if
else
beep
answer "Remove the password protection, please?" with "OK"
exit doMenu
end if
end if
if WhichItem is in "Print Report...,Print Stack...,Print Card" then
if textFont of bg fld "Text" is not "marker" then
pass doMenu
else
answer return &"You can't print a protected journal." with "Oh."
exit doMenu
end if
end if
-- trap command-F to bring up Find dialog box
if WhichItem is "Find..." then
cleanScreen
if textFont of bg fld "Text" is not "marker" then
searchAC 1
else
beep
end if
else
pass doMenu
end if
else
pass doMenu
end if
end doMenu
on erasePage
put empty into bg fld 1
put empty into bg fld 4
put the abbreviated date into bg fld "Date"
put "Sheet #" &number of this cd & " of " &number of cds into bg fld "Sheet"
end erasePage
on returnKey
global doFind
if visible of msg is false then
if doFind is not empty then --continue search
set cursor to 3
do doFind
else
pass returnKey
end if
else
pass returnKey
end if
end returnKey
-------------------init stack-------------------
on openStack
cleanScreen
if the version < 1.2 then
Answer "Hypercard version 1.2, or later, is available at your " &"Apple dealer. Many functions of this stack require the new " &"features. Continue?" with "Risk It" or "Go Home"
if it is "Go Home" then
Eject
exit openStack
end if
end if
if textFont of bg fld "Text" is "Marker" then
Clairvauxmarker
end if
if the short date is not bg fld "ShortDate" of cd 1 then
lock screen
put cantmodify of this stack into MTemp
set cantmodify of this stack to false
get line (random of number of lines of cd fld "Quotes" of cd 1) of cd fld "Quotes" of cd 1
put "Psalms " &item 1 of it into cd fld "PsalmNumber" of cd 1
put item 2 to number of items of it of it into cd fld "Psalmquote" of cd 1
put the short date into bg fld "ShortDate" of cd 1
set cantmodify of this stack to MTemp
unlock screen with dissolve
end if
initAll --fm Hills
About " ","If Monks had Macs..."
set userLevel to 5
end openStack
on resume
initAll
pass resume
end resume
on startUp
initAll
pass startUp
end startUp
on initAll
global whichButton,whichFindButton,textString,doFind
global Stacks,GVMsgLoc
put empty into textString
if Stacks is empty then
CheckGlobals
end if
put loc of msg into GVMsgLoc
get line 1 of bg fld "Hold Globals" of cd 1
if it is not empty then
put line 1 of bg fld "Hold Globals" of cd 1 into whichButton
put line 2 of bg fld "Hold Globals" of cd 1 into whichFindButton
put line 3 of bg fld "Hold Globals" of cd 1 into textString
-- field remembers Find dialog box settings between stack uses
else
-- if it doesn't remember, set defaults
put 3 into whichButton
put 3 into whichFindButton
put empty into textString
end if
if textFont of bg fld "Text" is "marker" then
set loc of msg to -1000,-1000
put empty into msg
hide msg
set blindTyping to false
end if
end initAll
on CheckGlobals
global GULevel,GPKeys,GTArrows
global GVPatn,GBTyping,GVMsg,GVTool
getHomeInfo
put the userLevel into GULevel
put the powerKeys Into GPKeys
put the textArrows into GTArrows
put the blindTyping into GBTyping
put the visible of the msg into GVMsg
put the visible of tool window into GVTool
put the visible of pattern window into GVPatn
end CheckGlobals
on closeStack
global whichButton,whichfindbutton,textString,FType,fieldName
global doFind,hits,X1,Y1,X2,Y2,X3,Y3,dir4,currentNO
global GULevel,GPKeys,GTArrows
global GVPatn,GBTyping,GVMsg,GVTool,GVMsgLoc
cleanScreen
hide bg btn "Find Next"
if GULevel is empty then
CheckGlobals
end if
set the userLevel to GULevel
set the powerKeys to GPKeys
set the textArrows to GTArrows
set the blindTyping to GBTyping
set the visible of the msg to GVMsg
set the visible of tool window to GVTool
set the visible of pattern window to GVPatn
if char 1 of GVMsgLoc > 0 and char 1 of GVMsgLoc < 9 then
set loc of msg to GVMsgLoc
else
set loc of msg to 22,300
end if
-- record find dialog box's most recent settings
put whichButton into line 1 of bg fld "Hold Globals" of cd 1
put whichFindButton into line 2 of bg fld "Hold Globals" of cd 1
put textString into line 3 of bg fld "Hold Globals" of cd 1
if the short date is not bg fld "ShortDate" of cd 1 then
put cantmodify of this stack into MTemp
set cantmodify of this stack to false
put the short date into bg fld "ShortDate" of cd 1
set cantmodify of this stack to MTemp
end if
put "GVMsgLoc,whichButton,whichfindbutton,textString,FType,fieldName" &"doFind,hits,X1,Y1,X2,Y2,X3,Y3,dir4,currentNO" into ClearList
repeat with i = 1 to number of items of ClearList
do "put empty into " &item i of clearList
end repeat
-- if textFont of bg fld "Text" is not "marker" then
-- answer "Encrypt Journal?" with "Yes" or "No"
-- if it is "Yes" then
-- Clairvauxmarker
-- end if
--end if
about
end closeStack
on Eject
set lockMessages to true
visual wipe right to black
visual dissolve
doMenu "home"
set userLevel to 5
end Eject
on Clairvauxmarker
global GVMsgLoc
cleanScreen
put script of bg fld "Pword" of cd 1 into Pswd
if textFont of bg fld "Text" is "Clairvaux" then
if optionKey() is not down then
answer "Encrypt Text?" with "No" or "Yes"
if it is "No" then
exit Clairvauxmarker
end if
if it is "Yes" then
set cursor to 3
ask password "Please type your password below." &return &"(If you have forgotten your password, see your owner's manual.)"
if it is pswd then
lock screen
send mouseUp to bg btn "Can't Modify"
hide cd fld "Quotes" of first cd
set textFont of bg fld "text" to marker
set lockText of bg fld "text" to true
set textFont of cd fld "CardInfo" of cd 1 to marker
set loc of msg to -1000,-1000
put empty into msg
hide msg
set blindTyping to false
unlock screen with dissolve
send mouseUp to bg btn "Can          Modify"
else
beep
answer "That is not the correct password."
end if
end if
exit Clairvauxmarker
else
Ask password "What is the current password?"
if it is empty then
exit Clairvauxmarker
end if
if it is Pswd then
Ask password "What is the new password?"
if it is empty or it is "0" then
beep
exit Clairvauxmarker
end if
put it into Pswd1
ask password "Again to confirm your new password choice:"
if it is empty or it is "0"then
beep
exit Clairvauxmarker
end if
if it is Pswd1 then
set script of bg fld "Pword" of cd 1 to Pswd1
else
beep
answer "The entries didn't match. Please try again."
end if
else
beep
answer "That is not the correct current password. Only" &" persons with the current password have permission to " &"change it." with "Oh."
end if
end if
exit Clairvauxmarker
end if
if textFont of bg fld "Text" is "marker" then
global tryCounter
Ask password "What is the password?"
if it is empty then
exit Clairvauxmarker
end if
if it is pswd then
set cursor to 3
lock screen
send mouseUp to bg btn "Can't Modify"
set textFont of bg fld "text" to Clairvaux
set lockText of bg fld "text" to false
set textFont of cd fld "CardInfo" of cd 1 to Clairvaux
unlock screen with dissolve
if char 1 of GVMsgLoc > 0 and char 1 of GVMsgLoc < 9 then
set loc of msg to GVMsgLoc
else
set loc of msg to 22,300
end if
put empty into tryCounter
else
put tryCounter + 1 into tryCounter
if tryCounter < 3 then
put 3 - tryCounter into triedCounter
beep
answer "Wrong Password. Authorized persons are" &return &"requested to please try again. Others are" &return &"asked not to pry. Tries left -- " &triedCounter
else
play "Boing"
answer "Wrong password. You must not be authorized to read the journal." &return &" Click here to go Home." with "I'm Sorry"
play "Boing"
Wait until the sound is "Done"
Eject
put empty into tryCounter
end if
exit Clairvauxmarker
end if
end if
end Clairvauxmarker
on edit
if textFont of bg fld "Text" is "Marker" then
else
pass edit
end if
end edit
-- This notice is in the stack script to keep it away from snoops.
-- When the Encyptor button is clicked and the text is set in the
-- Marker font, the userLevel is set to Browse (no peeking at these
-- instructions then by the casual viewer), the message box is hidden
-- (no setting the font of the text field by typing the appropriate
-- command into the message box), and the print text commands are
-- intercepted (no chance that the snoop can extract a printed copy
-- of your innermost secrets). (Command-shift-3 WILL export a screen
-- dump, though.
-- It's still possible to write a script that will begin on a card in
-- another stack, open this stack, extract the text, and put it in a
-- field in the other stack.
-- No claims are made that this scheme would meet NSC standards.
-- To change the password, hold down the optionKey and click on the
-- Encryptor button. The password is stored in the script of a field.
-- When the encryption is set, the script of the field is inaccesible
-- by normal means. It is important that you write down the new pass-
-- word and keep the piece of paper in a safe place. It's possible to
-- retrieve the password, but it is also encrypted into an integer
-- representation, not the password you have chosen for your copy of
-- this stack. Please don't change the password of copies you distribute
-- to others. Inform them of this notice.
-- To better protect your stack, use the built-in HC protection scheme,
-- which isn't all that foolproof, either, as there is a PD deprotector
-- available.
-- Designed by
-- Brian Thomas
-- Scripted by
-- Phillip A. Mohr Jr.
-- The list of people who deserve thanks (or blame) for the scripts
-- in this stack would have to include everyone whose work is represented
-- in my collection of HyperCard stacks. Since I haven't yet written the
-- script that will extract a list of the names of those authors, I'll
-- just offer a blanket thank you to those who see something that looks
-- familiar.
-- Specific thanks go to Oscar Hills for the Find Dialog Box and XCMD,
-- to David Dunham for the dogEar script, and to the Trustees of